package com.scm.service;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Map;

import com.scm.dao.ProductDao;
import com.scm.model.Product;
import com.scm.page.Page;
import com.scm.util.DbUtil;
import com.scm.util.PageUtil;

public class ProductService {
	public Page<Product> selectPage(int currentPage,Map<String, String> queryMap) throws SQLException{
		Connection conn = null;
		try{
			conn = DbUtil.getConn();
			ProductDao dao = new ProductDao(conn);
			return PageUtil.selectPage(dao, currentPage, queryMap);
		}finally{
			DbUtil.close(conn, null, null);
		}
	}
}
